package Reflection.annotation;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

/**
 * Created by admin on 2016-10-28.
 */
@Controller
public class never extends ne {
    @RequestMapping
    @Override
    public String toString(){
        return "";
    }

    public static void main(String[] args) throws NoSuchMethodException {
//        new never().test();
        Class clazz=never.class;
        Annotation[] annotations=clazz.getAnnotations();
        for (Annotation annotation:annotations){
            System.out.println(annotation.annotationType().getName());
        }

    }
    public void test() throws NoSuchMethodException, SecurityException{
        StackTraceElement[] stack = new Throwable().getStackTrace();
        Method method = this.getClass().getMethod(stack[0].getMethodName());
        for(Annotation an : method.getAnnotations()){
            System.out.println(an);
        }
    }
}
